#ifndef STORAGEDISPLAY_H
#define STORAGEDISPLAY_H

#include <QWidget>
#include <QLabel>
#include <QtCore>
#include <QtGui>

class StorageDisplay : public QWidget
{
    Q_OBJECT
public:
    StorageDisplay(QWidget *parent = 0);
    ~StorageDisplay();
    void setUsedValue(int value);
    //void setSize(int width, int height);
protected:
    void paintEvent(QPaintEvent *event);
    void resizeEvent (QResizeEvent * event);
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void showEvent(QShowEvent *event);
    void hideEvent(QHideEvent *event);

private slots:
    void slotUpdateTimer();

private:
    QPoint beginDrag;
    bool bPressFlag;

    QPixmap backGround;
    int userdVaule;
    int currentValue;
    QLabel *startValueLabel;
    QLabel *endValueLabel;
    QLabel *dispayValueLabel;

    QTimer *updateTimer;
};

#endif // STORAGEDISPLAY_H
